<template>
	<view>
		<view class="top text-lg bgw p30 ">
			<view>经营范围</view>
			<input type="text" maxlength="20" v-model="txt" placeholder="经营范围" value="" />
			<image @tap="txt = '' " class="demoves" src="../../static/image/icon_quxiao@2x.png"></image>
		</view>
		<view class="btn p30">
			<button @tap="send()" class="btnbg br42">确认修改</button>
		</view>
	</view>
</template>

<script>
	import {
		updateStoreInfo
	} from '@/api/api.js'
	export default {
		data() {
			return {
				shakeState: 0,
				txt: ''
			}
		},
		methods: {
			async send() {
				if (this.txt.size > 0) {
					uni.showToast({
						title: '经营范围不能为空',
						icon: 'none'
					})
				} else {
					let data = {
						"businessScope": this.txt
					}
					if (this.shakeState == 0) {
						this.shakeState = 1
						let state = await updateStoreInfo(data)
						if (state.code == 0) {
							this.shakeState = 0
							setTimeout(() => {
								uni.navigateBack()
							}, 1000)
						}
					} else {
						this.shakeState = 0
					}

				}
			}
		}
	}
</script>

<style lang="less" scoped>
	@import '../mobile/index.less';
</style>
